import java.util.Stack;

public class Test {
    public static void main(String[] args) {
        Stack<Integer> stack=new Stack<>();
        //入栈
        stack.push(12);
        stack.push(23);
        stack.push(34);
        stack.push(45);
        stack.push(56);
        //pop出栈
        Integer x=stack.pop();//56
        System.out.println(x);

        //peek获取栈顶元素  不删除
        Integer y=stack.peek();
        System.out.println(y);

        Integer y2=stack.peek();
        System.out.println(y2);
    }
}
